Optimal. Leaf size=15 \[ \frac{\tan (x)}{a}-\frac{\tanh ^{-1}(\sin (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0501199, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {2706, 3767, 8, 3770} \[ \frac{\tan (x)}{a}-\frac{\tanh ^{-1}(\sin (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2706
Rule 3767
Rule 8
Rule 3770
Rubi steps
\begin{align*} \int \frac{\tan ^2(x)}{a+a \cos (x)} \, dx &=-\frac{\int \sec (x) \, dx}{a}+\frac{\int \sec ^2(x) \, dx}{a}\\ &=-\frac{\tanh ^{-1}(\sin (x))}{a}-\frac{\operatorname{Subst}(\int 1 \, dx,x,-\tan (x))}{a}\\ &=-\frac{\tanh ^{-1}(\sin (x))}{a}+\frac{\tan (x)}{a}\\ \end{align*}
Mathematica [B] time = 0.0707014, size = 39, normalized size = 2.6 \[ \frac{\tan (x)+\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.053, size = 51, normalized size = 3.4 \begin{align*} -{\frac{1}{a} \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}+{\frac{1}{a}\ln \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{1}{a} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{1}{a}\ln \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.14815, size = 82, normalized size = 5.47 \begin{align*} -\frac{\log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}{a} + \frac{\log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right )}{a} + \frac{2 \, \sin \left (x\right )}{{\left (a - \frac{a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{\left (\cos \left (x\right ) + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.36594, size = 107, normalized size = 7.13 \begin{align*} -\frac{\cos \left (x\right ) \log \left (\sin \left (x\right ) + 1\right ) - \cos \left (x\right ) \log \left (-\sin \left (x\right ) + 1\right ) - 2 \, \sin \left (x\right )}{2 \, a \cos \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\tan ^{2}{\left (x \right )}}{\cos{\left (x \right )} + 1}\, dx}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.27762, size = 61, normalized size = 4.07 \begin{align*} -\frac{\log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right )}{a} + \frac{\log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right )}{a} - \frac{2 \, \tan \left (\frac{1}{2} \, x\right )}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} - 1\right )} a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]